#ifndef __road_sensor_h_
#define __road_sensor_h_
#include "adevs/adevs.h"
#include "io_type.h"

class RoadSensor: public adevs::Atomic<IO_Type> 
{
	public:
		/// Constructor.
		RoadSensor();
		/// Internal transition function.
		void delta_int();
		/// External transition function.
		void delta_ext(double e, const adevs::Bag<IO_Type>& xb);
		/// Confluent transition function.
		void delta_conf(const adevs::Bag<IO_Type>& xb);
		/// Output function.  
		void output_func(adevs::Bag<IO_Type>& yb);
		/// Time advance function.
		double ta();
		/// Output value garbage collection.
		void gc_output(adevs::Bag<IO_Type>& g);
		/// Destructor.
		~RoadSensor();
		/// Model input port.
		static const int in_arrive;
		static const int in_free;
		/// Model output port.
		static const int out_depart;
		static const int out_free;
		static const int out_tick_event;

	private:
		bool resend_free;
		Vehicle* vehicle;
};

#endif
